<template>
  <div>
    <input v-model="val" @keyup.enter="enter" type="text">
  </div>
</template>

<script>
export default {
    data(){
        return{
            val:"",
        }
    },
    created() {
        
    },
    methods:{
        enter(){
            let obj ={
                id:String(Math.random()).slice(5,9),
                name:this.val,
                time:Date.now()
            }
            this.$bus.$emit("sendObj",obj)
            this.val = ""
        }
    }
}
</script>

<style>

</style>